import java.util.Scanner;
public class CarTest {
    public static void main(String[] args) {
        
        //创建一个汽车对象
        Car a1 = new Car();

        //设置汽车颜色
        a1.setColour("blue");
        //设置汽车品牌
        a1.setBrand("xiaomi");
        //设置汽车价格
        a1.setPrice(99999.99);

        a1.show();
        //输入一个键盘数
        Scanner scan = new Scanner(System.in);

        System.out.println("Please enter a character w/s/a/d:");

        String str = scan.next();

        //前进
        if (str=="w") {
            a1.Forward();
        }
        //后退
        else if (str=="s") {
            a1.Retreat();
        }
        //左转
        else if (str=="a") {
            a1.TurnLeft();
        }
        //右转
        else if (str=="d") {
            a1.TurnRight();
        }
        //无效操作
        else{
            System.out.println("Invalid Operation!");
        }      
    }
}
